﻿/*
Copyright (c) 2010 Vratislav Cermak (vratacermak@gmail.com)
 
This file is part of TeachMe Project. See http://code.google.com/p/teach-me for more information.
 
TeachMe is an open source project. Using of TeachMe is free of charge.
It is distributed under GNU General Public License version 3 (GPLv3).
GPLv3 can be found at http://www.gnu.org/licenses/gpl.html.
 
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the license for more details.
*/

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection;

namespace TeachMe.Application.Forms.Options
{
    public partial class Tester : OptionsControl
    {
        public Tester()
        {
            InitializeComponent();

            foreach (PropertyInfo property in typeof(Color).GetProperties(BindingFlags.Static | BindingFlags.Public))
            {
                Color color = (Color)property.GetValue(null, null);
                fromBox.Items.Add(color);
                toBox.Items.Add(color);
                textBox.Items.Add(color);
            }
        }

        private void OnFromSelectedIndexChanged(object sender, EventArgs e)
        {
            group.From = (Color)fromBox.SelectedItem;

            Refresh();
        }

        private void OnToSelectedIndexChanged(object sender, EventArgs e)
        {
            group.To = (Color)toBox.SelectedItem;

            Refresh();
        }

        private void OnTextSelectedIndexChanged(object sender, EventArgs e)
        {
            group.Text = (Color)textBox.SelectedItem;

            Refresh();
        }

        internal override void SaveOptions()
        {
            //
        }

        internal override void LoadOptions()
        {
            //
        }
    }
}
